<?
require_once ("includes/func.php");
//header('Content-Type: application/rss+xml; charset=UTF-8', true);
header('Content-Type: text/xml; charset=UTF-8', true);
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>
<channel>
	<title>Лента новостей ресурса <?php echo HOME_ADDR; ?></title>
	<link><?php echo HOME; ?>/rss/</link>
	<description><![CDATA[<?php echo TITLE; ?>]]></description>
	<language>ru</language>
	<managingEditor><?php echo $admin_mail; ?> (Administrator)</managingEditor>
	<generator><?php echo HOME; ?></generator>
	<pubDate><?php echo date('r', time()); ?></pubDate>
	<atom:link href="<?php echo HOME; ?>/rss.xml" rel="self" type="application/rss+xml" />

<?php
$myPager = new Pager;
$select = $myPager -> getRss("blog");

if (mysql_num_rows($select) > 0)
{
    while ($data = mysql_fetch_array($select))
    {
	?>
	<item>
		<title>Новости: <?php echo $data['title']; ?></title>
		<guid isPermaLink="true"><?php echo HOME . MYDIR . $data['url'] . EXTENSION; ?></guid>
		<link><?php echo HOME . MYDIR . $data['url'] . EXTENSION; ?></link>
		<description><![CDATA[<?php echo $data['message']; ?>
		<a href="<?php echo HOME . MYDIR . $data['url'] . EXTENSION; ?>">Читать дальше &rarr;</a>]]></description>
		<pubDate><?php echo date('r', $data['time']); ?></pubDate>
	</item>
	<?php
    }
}
?>
</channel>
</rss>
